package cn.luischen.utils;

import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import org.junit.Rule;
import org.junit.runner.RunWith;
import org.junit.rules.ExpectedException;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.stubbing.Answer;
import java.lang.reflect.Method;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.ParserConfig;
import java.util.Map;
import java.util.List;
import com.unitspirit.runtime.*;

/**
<<<<<<< HEAD
 * The class <code>Job_WGTest</code> contains tests for the class <code>{@link Job}</code>.
*
* @generatedBy UnitSpirit CreateTemplateTestFile4
* @version 1.0.9.11 
*/
=======
 * The class contains tests for the class cn.luischen.utils.IPKit.
 *
 * @generatedBy UnitSpirit CreateTemplateTestFile4
 * @version 1.0.9.11 
 */
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
@PowerMockIgnore({ "javax.management.*" })
public class IPKit_getIpAddrByRequest_WGTest {
	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
<<<<<<< HEAD
	* 测试方法初始化.
	* 
	* @throws Exception 
	*         if the initialization fails for some reason 
	*  
	* @generatedBy UnitSpirit at 2021-09-07 17:52:12
	*/
=======
	 * 测试方法初始化.
	 * 
	 * @throws Exception 
	 *         if the initialization fails for some reason 
	 *  
	 * @generatedBy UnitSpirit at 2021-12-06 21:50:32
	 */
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	/**
<<<<<<< HEAD
	* @date 2021-09-07 17:52:13
	* @see cn.luischen.utils.IPKit#getIpAddrByRequest
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_getIpAddrByRequest_0113_190009_980_1_01() throws Throwable {
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_0 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		//返回值定义 
		String result_expected = "\"127.0.0.1\"";

		String mock_result_String1 = "\"127.0.0.1\"";
		;
		PowerMockito.when(HttpServletRequest_p_0.getRemoteAddr()).thenReturn(mock_result_String1);

		String unitspirit_result = cn.luischen.utils.IPKit.getIpAddrByRequest(HttpServletRequest_p_0);
		//getAssertCase 
		UnitAssert.assertEquals(result_expected, unitspirit_result);
	}

	/**
	* @date 2021-09-07 17:52:13
	* @see cn.luischen.utils.IPKit#getIpAddrByRequest
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_getIpAddrByRequest_0113_190009_980_1_02() throws Throwable {
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_0 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		//返回值定义 
		String result_expected = "\"127.0.0.1\"";

		String mock_result_String1 = "\"127.0.0.1\"";
		;
		PowerMockito.when(HttpServletRequest_p_0.getRemoteAddr()).thenReturn(mock_result_String1);

		String unitspirit_result = cn.luischen.utils.IPKit.getIpAddrByRequest(HttpServletRequest_p_0);
		//getAssertCase 
		UnitAssert.assertEquals(result_expected, unitspirit_result);
	}

	/**
	* @date 2021-09-07 17:52:13
	* @see cn.luischen.utils.IPKit#getIpAddrByRequest
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_getIpAddrByRequest_0113_190009_980_3_01() throws Throwable {
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_0 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		//返回值定义 
		String result_expected = "\"127.0.0.1\"";

		String mock_result_String1 = "\"127.0.0.1\"";
		;
		PowerMockito.when(HttpServletRequest_p_0.getRemoteAddr()).thenReturn(mock_result_String1);

		String unitspirit_result = cn.luischen.utils.IPKit.getIpAddrByRequest(HttpServletRequest_p_0);
		//getAssertCase 
		UnitAssert.assertEquals(result_expected, unitspirit_result);
	}

	/**
	* @date 2021-09-07 17:52:13
	* @see cn.luischen.utils.IPKit#getIpAddrByRequest
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_getIpAddrByRequest_0113_190009_980_3_02() throws Throwable {
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_0 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		//返回值定义 
		String result_expected = "\"127.0.0.1\"";

		String mock_result_String1 = "\"127.0.0.1\"";
		;
		PowerMockito.when(HttpServletRequest_p_0.getRemoteAddr()).thenReturn(mock_result_String1);

		String unitspirit_result = cn.luischen.utils.IPKit.getIpAddrByRequest(HttpServletRequest_p_0);
		//getAssertCase 
		UnitAssert.assertEquals(result_expected, unitspirit_result);
	}

	/**
	* @date 2021-09-07 17:52:13
	* @see cn.luischen.utils.IPKit#getIpAddrByRequest
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_getIpAddrByRequest_0113_190013_202_7_01() throws Throwable {
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_0 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		//返回值定义 
		String result_expected = "\"127.0.0.1\"";

		String mock_result_String1 = "\"127.0.0.1\"";
		;
		PowerMockito.when(HttpServletRequest_p_0.getRemoteAddr()).thenReturn(mock_result_String1);

		String unitspirit_result = cn.luischen.utils.IPKit.getIpAddrByRequest(HttpServletRequest_p_0);
		//getAssertCase 
		UnitAssert.assertEquals(result_expected, unitspirit_result);
	}

	/**
	* @date 2021-09-07 17:52:13
	* @see cn.luischen.utils.IPKit#getIpAddrByRequest
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_getIpAddrByRequest_0113_190013_202_7_02() throws Throwable {
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_0 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		//返回值定义 
		String result_expected = "\"127.0.0.1\"";

		String mock_result_String1 = "\"127.0.0.1\"";
		;
		PowerMockito.when(HttpServletRequest_p_0.getRemoteAddr()).thenReturn(mock_result_String1);

		String unitspirit_result = cn.luischen.utils.IPKit.getIpAddrByRequest(HttpServletRequest_p_0);
=======
	 * @date 2021-12-06 21:50:33
	 * @see cn.luischen.utils.IPKit#getIpAddrByRequest
	 * @category auto generate by UnitSpirit  
	 */
	@Test
	public void test_getIpAddrByRequest_20211109_110223_629_1_01()
			throws Throwable {
		javax.servlet.http.HttpServletRequest HttpServletRequest_p_0 = Mockito
				.mock(javax.servlet.http.HttpServletRequest.class);
		//返回值定义 
		String result_expected = "127.0.0.1";

		String unitspirit_result = cn.luischen.utils.IPKit
				.getIpAddrByRequest(HttpServletRequest_p_0);
>>>>>>> 3b028d6f1d2dd25e613c470e379df4ff28f4935e
		//getAssertCase 
		UnitAssert.assertEquals(result_expected, unitspirit_result);
	}

}
